

$(document).ready(function(){
	
	/* $("#barcode").hide(); */
	
	var a = "";
	$(document).keypress(function(e)
	{
		
		var s = String.fromCharCode(e.keyCode);
		a = a + s
        console.log(a);
		if(e.which == 13){
	//		alert(a.length);
	//		alert("hi"+a);
//			return a;
			if(a.length<18)
			{
				alert("Please scan again");
			}
			$('#barcode').val(a);
			$('#form').submit();
		}
		
		
	});
	/* $(document).keypress(function(e) {
     if(e.which == 13) {
	 console.log(String.fromCharCode(evt.keyCode));
        
//	alert(String.fromCharCode(evt.keyCode));
    } 
}); */

});